/**
 * 
 */
package com.thor.palmmall.rest.chart.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.chart.AMaintainReportCondition;
import com.thor.palmmall.spi.chart.SMaintainReportCondition;

/**
 * @author NuoSa
 *
 * @since 1.0
 */
public class SMaintainReportConditionConverter
    implements Converter<AMaintainReportCondition, SMaintainReportCondition> {

  public static SMaintainReportConditionConverter getInstance() {
    if (instance == null)
      instance = new SMaintainReportConditionConverter();
    return instance;
  }

  private static SMaintainReportConditionConverter instance;

  private SMaintainReportConditionConverter() {
  }

  @Override
  public SMaintainReportCondition convert(AMaintainReportCondition source) {
    if (source == null) {
      return null;
    }
    SMaintainReportCondition target = new SMaintainReportCondition();
    target.setDateRange(SDateRangeConverter.getInstance().convert(source.getDateRange()));
    target.setStore(source.getStore());
    return target;
  }

}
